package schoolmath.web.services;

import org.apache.tapestry5.ioc.annotations.Inject;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
import schoolmath.web.entities.Role;

public class RoleServiceImpl implements RoleService {

	@Inject
	private Session session;

	@Override
	public Role getRole(String name) {
		return (Role) session.createCriteria(Role.class).add(Restrictions.eq("name", name)).uniqueResult();
	}

}
